package com.aaa.project.zhreport.controller;

import com.aaa.framework.web.controller.BaseController;
import com.aaa.framework.web.domain.AjaxResult;
import com.aaa.framework.web.page.TableDataInfo;
import com.aaa.project.zhreport.domain.YwfxDataSources;
import com.aaa.project.zhreport.service.YwfxDataSourcesService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author baibin
 * @version 1.0
 * @date 2025/4/8 17:31
 * @description YwfxDataSourcesController
 */
@RestController
@RequestMapping("/data/sources")
public class YwfxDataSourcesController extends BaseController {

    @Resource
    private YwfxDataSourcesService service;

    @GetMapping("/list")
    public TableDataInfo listPage(YwfxDataSources query) {
        startPage();
        List<YwfxDataSources> list = service.listPage(query);
        return getDataTable(list);
    }

    @GetMapping("/list-all")
    public AjaxResult listAll(YwfxDataSources query) {
        return success(service.listPage(query));
    }
}
